<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
    class usuariomodel extends CI_Model
    {
        
        public function  __construct()
	{
                 parent::__construct();
	}
        
        function  loguear($user,$password)
        {    
            $query = $this->db->query("select user, password FROM usuario WHERE user = '".$user."' and password = '".$password."'");
            return $query->num_rows();
            
           
        }
       
       function  nivel($user,$password)
       {            
            $query = $this->db->query("select nivel FROM usuario WHERE user = '".$user."' and password = '".$password."'");
            if($query->num_rows()>0)
            {
               $row = $query->row();
               
               return $row->nivel;
            }
            
       }       
       
    }
?>
